1. Field of the Invention
The present invention relates to the generation of mixed-signal finite state machine models ensuring analog continuity.
2. Discussion of the Related Art
Simulation allows engineers to determine whether a design functions properly in a software environment before implementing it in silicon, real hardware, or embedded software. Specifically, simulation is used to predict the behavior of a system by relying on the mathematical models of the system components. Three levels of models are typically distinguished in system simulation: digital, analog, and mixed-signal.
A digital or event-driven model of a system describes the system with signal assignments, also called events. An event is scheduled and executed in response to changes of values of signals and uses the present values of signals it reads to determine new values for other signals. The signals are discontinuous variables, i.e. their change occurs at discrete time points. The connectivity between the different digital models in a design defines the signal flow. Due to their high simulation speed, digital models are usually preferred to simulate algorithms or electronic circuitries at a high level of abstraction (behavioral).
Analog models are used whenever the need arises to characterize detailed physical effects like energy transfers in an electrical network. Just like the effects they represent, analog models are continuous. They are composed of sets of simultaneous equations. These equations are differential and algebraic equations with sets of unknowns that are continuous functions of time. These unknowns are the analog variables of the system. While digital simulators primarily handle an event queue, analog solvers deal with a system of non-linear differential equations. In a transient analysis, most analog solvers choose the time points at which the system is solved in order to meet their accuracy criteria. Because of the highly iterative numerical techniques involved (numerical integration, non-linear solution algorithm and matrix inversion), analog simulation is computationally expensive, especially for large designs.
Mixed-signal models include both analog and digital components, and often focus on the interface between analog and digital systems. Such models allow portions of a digital system to be analyzed in more detail by using analog equations without the burden of simulating a fully analog design. Mixed-signal models are also needed when a system is explicitly mixed-signal with separate digital and analog parts. For example, a power converter includes analog switches and digital control circuitry working concurrently. Hardware description languages such as MAST, VHDL-AMS or Verilog-AMS, offer mixed-signal capabilities. However the exchange of data between the digital simulation kernel and the analog solver has to be implemented carefully by the author of the model in order to get accurate results and avoid convergence problems. The analog-to-digital conversion involves triggering events when analog conditions are met. The timing of the events often needs to rely on threshold detections. The digital-to-analog conversion involves creating continuous profiles using ramp or slew functions in order to avoid discontinuity in the analog equations. Mixed-signal modeling languages provide functions to implement these conversions, but this task remains non-trivial for most end-users and is still a barrier to potential increases in design productivity.
A popular way of representing a digital or event-driven system is through a state diagram description. State diagrams are a powerful visual formalism for capturing complex system behavior at a high level of abstraction. The models derived from a state diagram description are called finite state machine models. A finite state machine model represents a system that progresses through a series of states by responding to a set of transition conditions. The model stores all of the system's possible states, as well as each state's conditions to transition to another state. State charts have been widely used to describe digital or event-driven systems. The state transitions define the conditions upon which events are triggered. The actions performed during a transition (transition action, state entry or state exit action) are merely event-driven variable assignments assumed to take an insignificant amount of time. Most digital state machine modeling tools also support concurrency: more than one state can be active at the same time. This feature allows a user to easily model parallel activities in a system. States that are related directly or indirectly through transitions cannot be active at the same time. They are exclusive and belong to the same concurrent group of states. In a system, there are always as many concurrent groups as active states.
Several attempts to extend the state machine formalism to analog mixed-signal models have been proposed. Simplorer™, licensed by Ansoft Corporation, and Dymola™, licensed by Dynasim, are examples of commercial simulators allowing the user to create mixed-signal state machine models. In the case of Simplorer™, the state machines are digital but their time-discrete output can be directly used in the analog equations of the model. However the user is left with the task of inserting ramp functions outside the state machine to address discontinuities. This task requires significant modeling and computer language expertise. In the case of Dymola, analog equations defining analog variables can be directly associated with the states. But there is no provision to avoid discontinuity in the generated models.
The problem of discontinuity with respect to implementing a mixed-signal finite state machine model is further described in reference to FIGS. 1A and 1B. For example, consider a digitally controlled analog switch model (hereinafter switch model) 100 shown in FIG. 1A. Switch model 100 has two electrical terminals p and m, and a digital control pin c. As shown in FIG. 1B, switch model 100 comprises three states: “on”, “off” and “burnt”. The conditions that affect those states are the value of the input pin c (0 or 1) and the power dissipated by the switch (given by Ohm's law as the product of the voltage v by the current i). Setting the control pin to 0 results in the switch turning off, and setting the control pin to 1 results in the switch turning on. If the power dissipated in the switch exceeds a predetermined value pmax, then the switch moves into the “burnt” state.
In a mixed-signal finite state machine model (hereinafter model), the analog variables are defined through distinct equations depending on which state is active. For example in switch model 100, the current is defined as follows:
                                                        State              ⁢                                                          ⁢                              off                                ″                                                    ``                            ⁢                              :                                                                        i              =                              v                roff                                                                                        State              ⁢                                                          ⁢                              on                                ″                                                    ``                            ⁢                              :                                                                        i              =                              v                ron                                                                                        State              ⁢                                                          ⁢                              burnt                                ″                                                    ``                            ⁢                              :                                                                        i              =              0                                                          (        1        )            
In state “off”, switch model 100 provides a high resistance roff to current flowing between the p and m terminals. In state “on”, it provides a minimal resistance ron. In state “burnt”, switch model 100 allows no current to flow between the p and m terminals.
When a transition occurs in switch model 100, the simulator has to cope with stiff change in the model equations. If no precautions are taken during the model elaboration, the discontinuity in the analog equations is likely to result in simulation convergence problems. Specifically, it can cause spikes (e.g. unreal abrupt changes in voltage or current), higher sensitivity to simulation parameters (e.g. truncation error, time step, etc.), excessive CPU times, and/or aborted simulations. Because the switch is likely to be placed in a design that includes many other models, identifying the origin of the simulation problems and then resolving them can be highly time consuming.
Therefore, a need arises for a method of automatically implementing analog continuity in mixed-signal finite state machine models. This method must still allow the user to define concurrent states. Indeed, concurrency is an important feature of an event-driven state machine that must be preserved.